Fix vtpm build when doing 'make dist' (particularly when not root).
authorshand@ubuntu.eng.hq.xensource.com <shand@ubuntu.eng.hq.xensource.com>
Wed, 31 Aug 2005 22:37:21 +0000 (14:37 -0800)
committershand@ubuntu.eng.hq.xensource.com <shand@ubuntu.eng.hq.xensource.com>
Wed, 31 Aug 2005 22:37:21 +0000 (14:37 -0800)
Signed-off-by: Steven Hand <steven@xensource.com>
.hgignore
tools/Makefile
tools/vtpm/tpm_emulator.patch

index 038f93af487cf9f70c87b92fdad7d2fffd3fefc7..0bc47f730a8e2deba5013bdc6d70df45af135bd3 100644 (file)
--- a/.hgignore
+++ b/.hgignore
 ^tools/vnet/vnet-module/\.tmp_versions/.*$
 ^tools/vnet/vnet-module/vnet_module\.mod\..*$
 ^tools/vnetd/vnetd$
+^tools/vtpm/vtpm*
+^tools/vtpm/tpm_emulator-*
+^tools/vtpm_manager/manager/vtpm_managerd
 ^tools/web-shutdown\.tap$
 ^tools/x2d2/minixend$
 ^tools/xcs/xcs$
index 0549aad496e2944368af38a31fe7ef7742fb4c9f..1ed976476dd43abc2647e053703a057d41dec919 100644 (file)
@@ -16,6 +16,8 @@ SUBDIRS += vtpm_manager
 SUBDIRS += vtpm
 SUBDIRS += xenstat
 
+.PHONY: all install clean check check_clean ioemu eioemuinstall ioemuclean
+
 # These don't cross-compile
 ifeq ($(XEN_COMPILE_ARCH),$(XEN_TARGET_ARCH))
 SUBDIRS += python
index e36e7b7e720aaa2f0841225f9f11bce2bf4b1098..85d11feafcb618c1ad75b29dd9cba8ced04d85cf 100644 (file)
@@ -18,7 +18,7 @@ diff -uprN orig/tpm_emulator-0.2/ChangeLog tpm_emulator-0.2/ChangeLog
 diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
 --- orig/tpm_emulator-0.2/Makefile     2005-08-17 10:58:36.000000000 -0700
 +++ tpm_emulator-0.2/Makefile  2005-08-17 10:55:52.000000000 -0700
-@@ -1,15 +1,18 @@
+@@ -1,15 +1,19 @@
  # Software-Based Trusted Platform Module (TPM) Emulator for Linux
  # Copyright (C) 2004 Mario Strasser <mast@gmx.net>
 +# Copyright (C) 2005 INTEL Corp.
@@ -26,6 +26,7 @@ diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
  # $Id: Makefile 10 2005-04-26 20:59:50Z mast $
  
 +XEN_ROOT       := ../../..
++EUID           := $(shell id -u)
 +
  # kernel settings
  KERNEL_RELEASE := $(shell uname -r)
@@ -53,7 +54,7 @@ diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
  
  EXTRA_CFLAGS   += -I$(src) -I$(src)/crypto -I$(src)/tpm 
  
-@@ -42,23 +43,16 @@ all:       $(src)/crypto/gmp.h $(src)/crypto/l
+@@ -42,23 +43,17 @@ all:       $(src)/crypto/gmp.h $(src)/crypto/l
        @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) modules
  
  install:
@@ -64,8 +65,9 @@ diff -uprN orig/tpm_emulator-0.2/Makefile tpm_emulator-0.2/Makefile
 -      depmod -a
 +      @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) INSTALL_MOD_PATH=$(DESTDIR) modules_install
 +      test -d $(DESTDIR)/var/tpm || mkdir $(DESTDIR)/var/tpm
-+      test -c /dev/tpm0 || mknod /dev/tpm0 c 10 224
-+      chmod 666 /dev/tpm0
++      test -d $(DESTDIR)/dev || mkdir $(DESTDIR)/dev
++      test -c $(DESTDIR)/dev/tpm0 || [ $(EUID) -ne 0 ] || mknod $(DESTDIR)/dev/tpm0 c 10 224
++      [ $(EUID) -ne 0 ] || chmod 666 $(DESTDIR)/dev/tpm0
  
  clean:
        @$(MAKE) -C $(KERNEL_BUILD) M=$(CURDIR) clean